package com.neiquan.neiquandemo.test;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.widget.SeekBar;
import android.widget.TextView;

import com.neiquan.neiquandemo.R;

import net.neiquan.applibrary.barlibrary.ImmersionBar;
import net.neiquan.applibrary.base.BaseActivity;

import butterknife.ButterKnife;
import butterknife.InjectView;
/**
 * Created by gyf on 2016/10/24.
 */
public class PicActivity extends BaseActivity {
    @InjectView(R.id.text_view)
    TextView textView;
    @InjectView(R.id.seek_bar)
    SeekBar seekBar;
    @InjectView(R.id.toolbar)
    Toolbar toolbar;

    @Override
    public int getRootViewId() {
        return R.layout.activity_pic;
    }

    @Override
    public void setViews() {
        ImmersionBar.with(this)
                .titleBar(toolbar, false)
                .transparentBar()
                .init();
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                float alpha = (float) progress / 100;
                textView.setText("透明度:" + alpha + "f");
                ImmersionBar.with(PicActivity.this)
                        .addViewSupportTransformColor(toolbar, R.color.colorPrimary)
                        .navigationBarColorTransform(R.color.colorRed)
                        .barAlpha(alpha)
                        .init();
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
    }

    @Override
    public void initData() {

    }
}
